package com.bwie.controller;

import com.bwie.pojo.User;
import com.bwie.service.UserService;
import com.bwie.util.R;
import com.bwie.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @program: day0513-week3
 * @ClassName UserConteroller
 * @description:
 * @author: 段阳
 * @create: 2024-05-13 09:39
 **/
@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public R login(@RequestBody UserVo userVo){
        return userService.login(userVo);
    }

    @PostMapping("/vCode")
    public R vCode(@RequestBody UserVo userVo) throws IOException {
        return userService.vCode(userVo);
    }


}